package com.zbcz.erp.bean

import android.os.Parcel
import android.os.Parcelable

/**
 * 已完成任务数据类
 *
 * @property id 任务ID
 * @property name 任务名称
 * @property key 任务Key
 * @property description 任务描述
 * @property executionId 执行ID
 * @property assignee 任务受理人
 * @property owner 任务所有人
 * @property procDefId 流程定义ID
 * @property procInstId 流程实例ID
 * @property applyer 申请人
 * @property category 分类
 * @property priority 优先级
 * @property deleteReason 删除原因
 * @property comment 备注
 * @property duration 持续时间
 * @property workTime 工作时间
 * @property createTime 创建时间
 * @property startTime 开始时间
 * @property endTime 结束时间
 * @property dueTime 到期时间
 * @property processName 流程名称
 * @property routeName 路由名称
 * @property businessKey 业务键
 * @property tableId 表ID
 * @property tableName 表名称
 * @property assignees 任务受理人列表
 */
class DoneJobBean() : Parcelable {
    var id: String? = null
    var name: String? = null
    var key: String? = null
    var description: String? = null
    var executionId: String? = null
    var assignee: String? = null
    var owner: String? = null
    var procDefId: String? = null
    var procInstId: String? = null
    var applyer: String? = null
    var category: String?? = null
    var priority: Int = 0
    var deleteReason: String?? = null
    var wcomment: String?? = null
    var duration: Long = 0L
    var workTime: String? = null
    var createTime: String? = null
    var startTime: String? = null
    var endTime: String? = null
    var dueTime: String? = null
    var processName: String? = null
    var routeName: String? = null
    var businessKey: String? = null
    var tableId: String? = null
    var tableName: String? = null
    var assignees: String? = null
    var isSuspended: Boolean = false// 是否挂起（这里为false，表示任务处于活动状态）
    var result: Int = 0
    var status: Int = 0
    var title: String? = ""
    var userId: String? = ""
    var isHistory: String? = ""
    var currTaskName: String? = ""
    var firstGateway: String? = ""
    var sendMessage: String? = ""
    var sendSms: String? = ""
    var sendEmail: String? = ""

    constructor(parcel: Parcel) : this() {
        id = parcel.readString()
        name = parcel.readString()
        key = parcel.readString()
        description = parcel.readString()
        executionId = parcel.readString()
        assignee = parcel.readString()
        owner = parcel.readString()
        procDefId = parcel.readString()
        procInstId = parcel.readString()
        applyer = parcel.readString()
        category = parcel.readString()
        priority = parcel.readInt()
        deleteReason = parcel.readString()
        wcomment = parcel.readString()
        duration = parcel.readLong()
        workTime = parcel.readString()
        createTime = parcel.readString()
        startTime = parcel.readString()
        endTime = parcel.readString()
        dueTime = parcel.readString()
        processName = parcel.readString()
        routeName = parcel.readString()
        businessKey = parcel.readString()
        tableId = parcel.readString()
        tableName = parcel.readString()
        assignees = parcel.readString()
        isSuspended = parcel.readByte() != 0.toByte()
        result = parcel.readInt()
        status = parcel.readInt()
        title = parcel.readString()
        userId = parcel.readString()
        isHistory = parcel.readString()
        currTaskName = parcel.readString()
        firstGateway = parcel.readString()
        sendMessage = parcel.readString()
        sendSms = parcel.readString()
        sendEmail = parcel.readString()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(id)
        parcel.writeString(name)
        parcel.writeString(key)
        parcel.writeString(description)
        parcel.writeString(executionId)
        parcel.writeString(assignee)
        parcel.writeString(owner)
        parcel.writeString(procDefId)
        parcel.writeString(procInstId)
        parcel.writeString(applyer)
        parcel.writeString(category)
        parcel.writeInt(priority)
        parcel.writeString(deleteReason)
        parcel.writeString(wcomment)
        parcel.writeLong(duration)
        parcel.writeString(workTime)
        parcel.writeString(createTime)
        parcel.writeString(startTime)
        parcel.writeString(endTime)
        parcel.writeString(dueTime)
        parcel.writeString(processName)
        parcel.writeString(routeName)
        parcel.writeString(businessKey)
        parcel.writeString(tableId)
        parcel.writeString(tableName)
        parcel.writeString(assignees)
        parcel.writeByte(if (isSuspended) 1 else 0)
        parcel.writeInt(result)
        parcel.writeInt(status)
        parcel.writeString(title)
        parcel.writeString(userId)
        parcel.writeString(isHistory)
        parcel.writeString(currTaskName)
        parcel.writeString(firstGateway)
        parcel.writeString(sendMessage)
        parcel.writeString(sendSms)
        parcel.writeString(sendEmail)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<DoneJobBean> {
        override fun createFromParcel(parcel: Parcel): DoneJobBean {
            return DoneJobBean(parcel)
        }

        override fun newArray(size: Int): Array<DoneJobBean?> {
            return arrayOfNulls(size)
        }
    }
}



